#!/bin/bash
clear
echo "1.服务器"
echo "2.树莓派"
read -p "请选择:" name
if [ $name == '1' ]; then
	echo "开始安装"
	read -p "请设置后台账号:" user
	read -p "请设置后台密码:" pwd
	wget https://zhuxiaohuan-1252924679.cos.ap-nanjing.myqcloud.com/%E4%B8%8B%E8%BD%BD/frp_0.39.1_linux_amd64.tar.gz
	tar -zxvf frp_0.39.1_linux_amd64.tar.gz
	cd frp_0.39.1_linux_amd64
	echo "
[common]
#服务器监听端口
#对网穿透http端口
vhost_http_port =8080
#管理页面防访问端口
dashboard_port = 7500
# dashboard's username and password are both optional，if not set,       def		ault is admin.
dashboard_user = $user
dashboard_pwd = $pwd
        " >frps.ini
fi
rm -f frp_0.39.1_linux_amd64.tar.gz
rm -f frp.sh
echo "
安装完成
-------------------------
后台地址：http://ip:7500
账号：$user
密码：$pwd
服务启动命令：./frps -c ./frps.ini
注意：腾讯云和阿里云需要打开7500端口
windows客户端：https://gitee.com/zhuxiaohuaqn/Linux_shell/raw/master/tool/frp_0.39.1_windows_amd64.zip
"
exit 8